package com.efuture.androidmvvmdemo.net

import com.efuture.netrequestdemo.bean.Project
import com.efuture.netrequestdemo.bean.User
import kotlinx.coroutines.Deferred
import retrofit2.Response

/**

 *@description:请求参数封装
 * @author: zhaoshanshan
 * @date: 2022/3/25 1:58 上午

 */
object ApiParameter {

    fun registerUser(userName:String,passWord:String,rePassWprd:String): Deferred<Response<User>> {
        val param : Map<String,Any> = hashMapOf(
            //添加参数
            "username" to userName,
            "password" to passWord,
            "repassword" to rePassWprd
        )
        return NetService.apiService.registerUser(param)
    }

    fun loginUser(userName:String,password:String):Deferred<Response<User>>{
        val param : Map<String,Any> = hashMapOf(
            //添加参数
            "username" to userName,
            "password" to password,
        )
        return NetService.apiService.loginUser(param)
    }

    fun getProject(cid:String):Deferred<Response<Project>>{
        //?cid=294
        val param : Map<String,Any> = hashMapOf(
            //添加参数
            "cid" to cid,
        )
        return NetService.apiService.getProjectData(param)

    }

}